/* 
 * File:   Command.cpp
 * Author: Gab'z
 * 
 * Created on 25 mai 2012, 13:50
 */

#include "Command.h"
#include "literal/Literal.h"

namespace calculator {
    Logger* Command::log = LoggerManager::getInstance()->getLogger("Command");

    Command::Command(const std::string name) : _name(name) {
        const Literal* literal = dynamic_cast<const Literal*> (this);
        if (literal != 0) {
            log->trace("CREATING command " + literal->toString());
        } else log->trace("CREATING command " + toString());
    }

    Command::~Command() {
        log->trace("DELETING command " + toString());
    }

    std::string Command::toString() const {
        return _name;
    }

}
